Lcd12864 Chinese data summary (12864 pin description and function _features parameters and driver sharing)

Lcd12864 Introduction

The 128X64 with Chinese character library is a dot matrix graphic LCD module with 4-digit/8-bit parallel, 2-wire or 3-wire serial interface, and internal Chinese GB first-level and second-level simplified Chinese fonts; The rate is 128 & TImes; 64, 8192 16*16 dot Chinese characters, and 128 16*8 dot ASCII character sets. The use of this module's flexible interface method and simple and convenient operation instructions can constitute a full Chinese human-computer interaction graphical interface. Can display 8 & TImes; 4 lines of 16 & TImes; 16 lattice characters. Graphic display can also be completed. Low voltage and low power consumption are another significant feature. The liquid crystal display scheme composed of this module is much simpler than the same type of graphic dot matrix liquid crystal display module regardless of the hardware circuit structure or the display program, and the price of this module is also slightly lower than that of the same dot matrix graphic liquid crystal module. .

Lcd12864 basic characteristic parameters

(1) Low Supply Voltage (VDD: +3.0--+5.5V)

(2) Display resolution: 128 & TImes; 64 points

(3) Built-in Chinese character library, providing 8192 16×16 lattice Chinese characters (Simplified and Traditional)

(4) Built-in 128 16 × 8 dot matrix characters

(5) 2MHZ clock frequency

(6) Display mode: STN, semi-transparent, positive display

(7) Drive: 1/32 DUTY, 1/5 BIAS

(8) Direction of view: 6 points

(9) Backlight mode: Side highlight white LED, power consumption is only 1/5-1/10 of common LED

(10) Communication: Serial and Parallel

(11) Built-in DC-DC conversion circuit without external negative pressure

(12) Simplify software design without chip select signal

(13) Operating temperature: 0°C-+55°C, storage temperature: -20°C-+60°C

Lcd12864 pin diagram and function
Lcd12864 Chinese data summary (12864 pin description and function _features parameters and driver sharing)

1VSS-module power ground

2VDD-power positive terminal of the module

3V0-LCD drive voltage input

4RS(CS)H/L Parallel Instruction/Data Select Signals; Serial Chip Select Signals

5R/W(SID) H/L parallel read/write selection signal; serial data port

6E(CLK)H/L parallel enable signal; serial synchronous clock

7DB0H/L data 0

8DB1H/L data 1

9DB2H/L data 2

10DB3H/L data 3

11DB4H/L data 4

12DB5H/L data 5

13DB6H/L data 6

14DB7H/L data 7

15PSBH/L Parallel/Serial Interface Selection: H-Parallel; L-Serial

16NC empty foot

17/RETH/L reset active low

18NC empty foot

19LED_A (LED+5V) Positive Backlight

20LED_K (LED-OV) backlight and negative

Controller Interface Signal Description

1, RS, R / W with the choice of control interface determines the four modes:

Lcd12864 Chinese data summary (12864 pin description and function _features parameters and driver sharing)

2, E signal

Lcd12864 Chinese data summary (12864 pin description and function _features parameters and driver sharing)

● Busy flag: The BFBF flag provides internal operating conditions. BF=1 indicates that the module is performing internal operations. At this time, the module does not accept external instructions and data. When BF=0, the module is ready to accept external instructions and data at any time. With the STATUSRD instruction, BF can be read to the DB7 bus to verify the module's operating status.

● Font generation ROM (CGROM) Font generation ROM (CGROM) provides 8192 This trigger is used to control the on-screen display of the module. DFF=1 is DISPLAY ON, DDRAM content is displayed on the screen, DFF=0 is DISPLAY OFF. The status of the DFF is controlled by the commands DISPLAYON/OFF and RST signals.

● Display data RAM (DDRAM) module internal display data RAM provides 64×2 bytes of space, up to 4 lines of 16 words (64 words) of Chinese character display, when written to display data RAM, Display the fonts of CGROM and CGRAM respectively; this module can display three types of fonts, which are half-width alphanumeric (16*8), CGRAM fonts, and Chinese fonts of CGROM. The choice of three fonts is based on the DDRAM. In the encoding option written in Chinese, the custom font of CGRAM will be selected in the encoding of 0000H-0006H (the codes thereof are respectively 0000, 0002, 0004, and 0006), and the half-width alphanumeric characters will be selected in 02H-7FH encoding. The font, as for the code above A1 will be automatically combined with the next byte, and the coding of the two bytes forms the Chinese character code BIG5 (A140-D75F), GB (A1A0-F7FFH).

● Font generation RAM (CGRAM) font generation RAM provides image definition (word building) function, which can provide four groups of 16×16 points of custom image space. Users can provide image characters not provided by internal fonts. Type is self-defined to CGRAM and can be displayed on the screen through DDRAM as defined in CGROM.

● The address counter AC address counter is used to store the address of one of the DDRAM/CGRAM. It can be changed by the setting instruction register. Afterwards, as long as the value of DDRAM/CGRAM is read or written, the value of the address counter will be Add one automatically. When RS is "0" and R/W is "1", the value of the address counter is read into DB6-DB0.

Cursor/flicker control circuit

This module provides a hardware cursor and flicker control circuit that specifies the cursor or blink position in the DDRAM by the value of the address counter.

Lcd12864 instructions
Lcd12864 Chinese data summary (12864 pin description and function _features parameters and driver sharing)
Lcd12864 Chinese data summary (12864 pin description and function _features parameters and driver sharing)

Note: Before IC1 accepts the instruction, the microprocessor must first confirm that the internal is in an off-busy condition. When reading the BF flag, BF must be zero to accept new instructions; if it is not checked before sending an instruction The BF flag must then be extended for a longer period of time between the previous instruction and the instruction, that is, waiting for the previous instruction to be executed.

Lcd12864 application example

1. Preparation before use: Apply the working voltage to the module first, and then adjust the contrast of the LCD according to the connection method in the figure below so that it shows the black bottom image. This process can also initially detect whether the LCD segment is missing.

2. Character display: 128X64-0402B with Chinese character library can display 4 rows and 8 columns of 32 characters with 16 16 dot matrix per screen. Each display RAM can display 1 Chinese character or 2 16×8 lattice full heights. ASCII characters, which can display up to 32 Chinese characters or 64 ASCII characters per screen. The 128X64-0402B with Chinese font library internally provides a 128 x 2 byte character display RAM buffer (DDRAM). The character display is achieved by writing character display codes into the character display RAM. Depending on the contents of the writing, the contents of CGROM (Chinese font library), HCGROM (ASCII font font), and CGRAM (custom font) can be displayed on the LCD screen. Three different characters / font selection code range: 0000 ~ 0006H (the code is 0000,0002,0004,0006 a total of 4) display custom font, 02H ~ 7FH display half-width ASCII code character, A1A0H ~ F7FFH shows 8192 GB2312 font fonts. The character shows the address 80H to 9FH of the RAM in the liquid crystal module. The address of the RAM displayed by the character has a one-to-one correspondence with the 32-character display area. The correspondence is shown in the following table.

Lcd12864 Chinese data summary (12864 pin description and function _features parameters and driver sharing)

3, graphic display

First set the vertical address and then set the horizontal address (write two bytes of data to complete the vertical and horizontal coordinate address)

Vertical address range AC5. .AC0

Horizontal address range AC3...AC0

The address counter (AC) of the drawing RAM will only automatically increase the horizontal address (X axis). When the horizontal address = 0FH, it will be reset to 00H but it will not be automatically incremented by the carry of the vertical address. When multiple documents are available, the program needs to determine if the vertical address needs to be reset. GDRAM coordinate address and data arrangement order as shown below:

4, application description

When using a 128X64 display module with a Chinese font library, note the following points:

1 When you want to display Chinese characters in a certain position, you should first set the display character position, that is, set the display address first, and then write the Chinese character code.

2 The process of displaying ASCII characters is the same as the process of displaying Chinese characters. However, when displaying continuous characters, you only need to set the display address once. The module automatically adds 1 to the next character position. Otherwise, the displayed character will have an empty ASCII character position.

3 When the character code is 2 bytes, the upper byte should be written first, followed by the lower byte.

4 Before the module receives the instruction, the processor must first confirm that the module is in an unbusy state. That is, when the BF flag is read, BF must be “0” to accept the new instruction. If the BF flag is not checked before sending an instruction, it must be delayed a long time between the previous instruction and this instruction, that is, waiting for the previous instruction to determine that the execution is completed. For the instruction execution time, refer to the instructions execution time description in the instruction table. 5 "RE" is the selection control bit for the basic instruction set and extended instruction set. When "RE" is changed, the subsequent instruction set will remain in the last state. Unless the "RE" bit is changed again, it is not necessary to reset the "RE" bit each time the same instruction set is used.

Lcd12864 driver

/************************************************* ***************************/

/* */

/* Copyright (c) 2012, pcwebmaster */

/* All rights reserved. */

/* */

/* Email: */

/* */

/************************************************* ***************************/

/************************************************* ***************************/

/* File name: LCD12864.c */

/* Version: Version 1.0 */

/* Description: Realize the communication protocol between LCD and SCM, and perform human-computer interaction according to the commands issued by the computer */

/ * Author: pcwebmaste * /

/* Function: */

/* LCD12864_init */

/* LCD12864WriteCommand */

/* LCD12864WriteByte */

/* LCD12864_init */

/* LCD12864SetXY */

/* LCD12864PrintfString */

/* history record: */

/* pcwebmaste 2008-07-10 Creat Inital version. (Version 1.0) */

/* Modular 2012-06-02 Creat Inital version. (Version 2.0) */

/************************************************* ***************************/

#include "12864.h"

#define LOW 0

#define HIGH 1

Sbit wela = P2^6;

Sbit dula = P2^7;

#define LCD12864_RS(x) {if((x))P3 |= 1 "LCD12864_RS_PIN;\

Else P3 &=~(1 "LCD12864_RS_PIN);}//register selection input

#define LCD12864_RW(x) {if((x))P3 |= 1 "LCD12864_RW_PIN;\

Else P3 &=~(1 "LCD12864_RW_PIN);}//LCD read/write control

#define LCD12864_EN(x) {if((x))P3 |= 1 "LCD12864_EN_PIN;\

Else P3 &=~(1 "LCD12864_EN_PIN);}//LCD Enable Control

#define LCD12864_MD(x) {if((x))P3 |= 1 "LCD12864_MD_PIN;\

Else P3 &=~(1 "LCD12864_MD_PIN";}//string/parallel control

#define LCDWELA(x) {if((x))P2 |= 1 "6; else P2 &=~(1" "6";}

#define LCDDULA(x) {if((x))P2 |= 1 "7; else P2 &=~(1"7";}

#define DelayNOP() {_nop_();_nop_();_nop_();_nop_();}

/*********************************************/

/* */

/* Main program*/

/* */

/*********************************************

Void main()

{

DelayNOP(); //Delay

Wela=LOW;

Dula=LOW;

LCD12864_init(); // Initialize the LCD

LCD12864PrintfString(0,1,dis1);

LCD12864PrintfString(1,0,dis2);

LCD12864PrintfString(2,0,dis3);

LCD12864PrintfString(3,1,dis4);

While(1);

}

/********************************************

*Function Name: LCD12864_init

* Input: None

* Output: When lcd_busy is 1, busy, waiting.

When lcd-busy is 0, free, writable instructions and data

*Note: LCD12864 LCD check busy status

/*******************************************/

Bit LCD1286_busy()

{

Bit result;

LCD12864_RS(LOW);

LCD12864_RW(HIGH);

LCD12864_EN(HIGH);

DelayNOP();

Result = (bit)(LCD12864_PORT&0x80);

LCD12864_EN(LOW);

Return(result);

}

/********************************************

*Function Name: LCD12864WriteCommand

*Enter: ucCmd Command to write

* Output: None

*Description: LCD12864 write command

RS = L, RW = L, E = high pulse, D0-D7 = instruction code.

********************************************/

Void LCD12864WriteCommand(unsigned char ucCmd)

{

While(LCD1286_busy());

LCD12864_RS(LOW);

LCD12864_RW(LOW);

LCD12864_EN(LOW);

_nop_();

_nop_();

LCD12864_PORT = ucCmd;

DelayNOP();

LCD12864_EN(HIGH);

DelayNOP();

LCD12864_EN(LOW);

}

/********************************************

*Function Name: LCD12864WriteByte

* Input: ucByte bytes to be written

* Output: None

*Note: LCD12864 write bytes

RS=H, RW=L, E=high pulse, D0-D7=data.

********************************************/

Void LCD12864WriteByte(unsigned char ucByte)

{

While(LCD1286_busy());

LCD12864_RS(HIGH);

LCD12864_RW(LOW);

LCD12864_EN(LOW);

LCD12864_PORT = ucByte;

DelayNOP();

LCD12864_EN(HIGH);

DelayNOP();

LCD12864_EN(LOW);

}

/********************************************

*Function Name: LCD12864_init

* Input: None

* Output: None

*Description: LCD12864LCD initialization settings

/*******************************************/

Void LCD12864_init()

{

LCD12864_MD(HIGH); //parallel port mode

LCD12864WriteCommand(0x34); //Extend instruction operation

LCD12864WriteCommand(0x30); //Basic instruction operation

LCD12864WriteCommand(0x0C); //display on, off cursor

LCD12864WriteCommand(0x01); //Clear display contents of LCD

}

/********************************************

*Function Name: LCD12864SetXY

*Input: x abscissa y ordinate

* Output: None

*Description: LCD12864 setting coordinates

********************************************/

Void LCD12864SetXY(unsigned char X, unsigned char Y)

{

If (X==0)

{X=0x80;}

Else if (X==1)

{X=0x90;}

Else if (X==2)

{X=0x88;}

Else if (X==3)

{X=0x98;}

LCD12864WriteCommand(X+Y); //display address

}

/********************************************

*Function Name: LCD12864SetXY

*Input: x abscissa y ordinate

* Output: None

*Description: LCD12864 setting coordinates

Why can't I write it?

********************************************

Void LCD12864SetXY(unsigned char x, unsigned char y)

{

Switch(y)

{

Case 1:

{

LCD12864WriteCommand(0x80+x);

}

Break;

Case 2:

{

LCD12864WriteCommand(0x90+x);

}

Break;

Case 3:

{

LCD12864WriteCommand(0x88+x);

}

Break;

Case 4:

{

LCD12864WriteCommand(0x98+x);

}

Break;

Default:break;

}

// LCD12864WriteCommand(x+y); //display address

}

/********************************************

*Function Name: LCD12864PrintfString

* Input: x abscissa y ordinate s string

* Output: None

*Note: LCD12864 prints the string

********************************************/

Void LCD12864PrintfString(unsigned char x, unsigned char y, unsigned char *s)

{

LCD12864SetXY(x,y); //Set display coordinates

While(s && *s)

{

LCD12864WriteByte(*s); //Display character by character

s++;

}

}

/************************************************* ***************************/

/* */

/* Copyright (c) 2012, pcwebmaster */

/* All rights reserved. */

/* */

/* Email: */

/* */

/************************************************* ***************************/

/************************************************* ***************************/

/* File name: LCD12864.c */

/* Version: Version 1.0 */

/* Description: Realize the communication protocol between LCD and SCM, and perform human-computer interaction according to the commands issued by the computer */

/ * Author: pcwebmaste * /

/* Function: */

/* LCD12864_init */

/* LCD12864WriteCommand */

/* LCD12864WriteByte */

/* LCD12864_init */

/* LCD12864SetXY */

/* LCD12864PrintfString */

/* history record: */

/* pcwebmaste 2008-07-10 Creat Inital version. (Version 1.0) */

/* Modular 2012-06-02 Creat Inital version. (Version 2.0) */

/************************************************* ***************************/

#ifndef __12864_H__

#define __12864_H__

#include reg52.h

#include "intrins.h"

#define LCD12864_PORT P0 //Data port

#define LCD12864_RS_PIN 5

#define LCD12864_RW_PIN 6

#define LCD12864_EN_PIN 4

#define LCD12864_MD_PIN 7

Unsigned char code dis1[] = {"China Changle is a gem"};

Unsigned char code dis2[] = {"The capital, watermelon town!"};

Unsigned char code dis3[] = {"China Changle Gems City"};

Unsigned char code dis4[] = {"People welcome you!"};

/********************************************

*Function Name: LCD12864_init

* Input: None

* Output: When lcd_busy is 1, busy, waiting.

When lcd-busy is 0, free, writable instructions and data

*Note: LCD12864 LCD check busy status

/*******************************************/

Bit LCD1286_busy();

/********************************************

*Function Name: LCD12864WriteCommand

*Enter: ucCmd Command to write

* Output: None

*Description: LCD12864 write command

RS = L, RW = L, E = high pulse, D0-D7 = instruction code.

********************************************/

Void LCD12864WriteCommand(unsigned char ucCmd);

/********************************************

*Function Name: LCD12864WriteByte

* Input: ucByte bytes to be written

* Output: None

*Note: LCD12864 write bytes

RS=H, RW=L, E=high pulse, D0-D7=data.

********************************************/

Void LCD12864WriteByte(unsigned char ucByte);

/********************************************

*Function Name: LCD12864_init

* Input: None

* Output: None

*Description: LCD12864LCD initialization settings

/*******************************************/

Void LCD12864_init();

/********************************************

*Function Name: LCD12864SetXY

*Input: x abscissa y ordinate

* Output: None

*Note: LCD12864 setting coordinates

********************************************/

Void LCD12864SetXY(unsigned char X, unsigned char Y);

/********************************************

*Function Name: LCD12864PrintfString

* Input: x abscissa y ordinate s string

* Output: None

*Note: LCD12864 prints the string

********************************************/

Void LCD12864PrintfString(unsigned char x, unsigned char y, unsigned char *s);

Void LCD12864PrintfData(unsigned char x, unsigned char y, unsigned char DData);

/********************************************

*Function Name: LCD12864PrintfNum

*Enter:add ge shi bai

* Output: None

*Explanation: This function is not well-written as a generic function, in a continuous address

Continuously write the number half-width display. Modify according to the situation

********************************************/

Void LCD12864PrintfNum(unsigned char add, unsigned char ge, unsigned char shi, unsigned char bai)

{

LCD12864WriteCommand(add);

LCD12864WriteByte(bai+0x30);

LCD12864WriteByte(shi+0x30);

LCD12864WriteByte(ge+0x30);

}

#endif

Education Tablet

As a mobile multi-purpose platform, tablet computers also provide many possibilities for mobile teaching. The touch-based learning & entertainment teaching platform allows children to efficiently improve their academic performance in a relaxed and pleasant atmosphere. Such tablet computers generally integrate two learning sections of various courses and systematic learning functions. Generally, it includes multi-disciplinary high-quality teaching resources. The education tablet has the following main functions: it has the functions of touch screen input, text editing, picture editing, data storage, data management, wired and wireless Internet access that ordinary tablet computers have; Management functions, search methods support manual search, query by keyword, query by time; text and pictures can be scanned and converted into documents to save.

Education Tablet,learning tablet,leaning machine,New learning tablet

Jingjiang Gisen Technology Co.,Ltd , https://www.jsgisengroup.com